package com.webank.wedatasphere.qualitis.response;

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//


import com.webank.wedatasphere.qualitis.project.entity.Project;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Grid<T> implements Serializable {
    private int total = 0;
    private List<T> rows = new ArrayList();
    private Object content;
    private int draw;
    private int recordsTotal;
    private int recordsFiltered;

    public Grid() {
    }

    public static<T> Grid<T> OkPage(List<T> content, long totalElements) {
        Grid<T> grid = new Grid<>();
        grid.setRows(content);
        grid.setTotal((int)totalElements);
        return grid;
    }

    public int getTotal() {
        return this.total;
    }

    public void setTotal(int total) {
        this.total = total;
        this.recordsTotal = total;
        this.recordsFiltered = total;
    }


    public List<T> getRows() {
        return this.rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public Object getContent() {
        return this.content;
    }

    public void setContent(Object content) {
        this.content = content;
    }

    public int getDraw() {
        return this.draw;
    }

    public void setDraw(int draw) {
        this.draw = draw;
    }

    public int getRecordsTotal() {
        return this.recordsTotal;
    }

    public void setRecordsTotal(int recordsTotal) {
        this.recordsTotal = recordsTotal;
    }

    public int getRecordsFiltered() {
        return this.recordsFiltered;
    }

    public void setRecordsFiltered(int recordsFiltered) {
        this.recordsFiltered = recordsFiltered;
    }
}

